package com.sailors.common.task.provider.infra.system.config.topics;

import com.sailors.common.task.provider.infra.system.constant.Topics;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Topics config
 *
 * @description:
 * @author: cyj
 * @date 2022 -11-25 11:17:20
 */
@Configuration
public class TopicsConfig {

    /**
     * Task process new topic
     *
     * @return the new topic
     */
    @Bean
    public NewTopic taskProcess() {
        return new NewTopic(Topics.TASK_PROCESS, 3, (short) 2);
    }

    /**
     * Failed file task new topic
     *
     * @return the new topic
     */
    @Bean
    public NewTopic failedFileTask() {
        return new NewTopic(Topics.FAILED_FILE_TASK, 3, (short) 2);
    }

}
